using System;
using Randomize.Core.Generators;

namespace Randomize.Core.Descriptors
{
    public class DateTimeDescriptor : RangeGenerationDesciptor<DateTime, IDateTimeDescriptor>, IDateTimeDescriptor
    {
        private bool _ignoreTime;

        public override IGenerator<DateTime> CreateGenerator(Random random)
        {
            return new DateTimeGenerator(random) {Min = this.Min, IgnoreTime = _ignoreTime, Pool = this.Pool, Max = this.Max};
        }

        public IDateTimeDescriptor IgnoreTime()
        {
            _ignoreTime = true;
            return this;
        }
    }
}